package com.rui.patterns.builder.demo1;

/**
 * @author : [锐神NO.3]
 * @version : [v1.0]
 * @className : Director
 * @createTime : [2022/2/21 14:12]
 * @description : [指挥者类]
 */

public class Director {

    /**
     * 声明Builder类型的变量
     */
    private Builder builder;

    /**
     * 构造方法
     * @param builder
     */
    public Director(Builder builder) {
        this.builder = builder;
    }

    /**
     * 组装自信车
     */
    public Bike construct(){
        builder.buildFrame();
        builder.buildSeat();
        return builder.createBike();
    }
}
